package 力扣日常刷题.木23一月.第20天320;

public class Demo104缺少数字 {


    public int missingNumber(int[] nums) {
        int l = 0,r = nums.length - 1;

        while(l <=r ) {
            int m = (l + r) >> 1;
            if(nums[m] == m) l = m + 1;
            else r = m - 1;
        }
        return l;
    }
}
